from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
from login import Login
from options import options

url = r'http://172.16.36.121/upload/'
username = 'test02'
pwd = '123456'
driver = webdriver.Chrome(options=options)
driver.get(url)
driver.maximize_window()

login = Login(driver)
login.login(username, pwd)

sleep(3)

# 回帖
driver.find_element(By.XPATH, '//*[@id="category_1"]/table/tbody/tr[1]/td[2]/h2/a').click()
driver.find_element(By.XPATH, '//*[@id="normalthread_14"]/tr/th/a[2]').click()

driver.find_element(By.CSS_SELECTOR, 'fastre').click()
driver.find_element(By.ID, 'postmessage').send_keys('回复我的帖子01')
sleep(3)
driver.find_element(By.XPATH, '//*[@id="postsubmit"]/span').click()

login.loginout()
sleep(3)
